package com.atguigu.iocTest;

import com.atguigu.entity.HappyFactory;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author : zzf
 * @date : 2021/1/4
 */


public class IocTest {
    private final ApplicationContext iocContext = new ClassPathXmlApplicationContext("applicationContext.xml");

    @Test
    public void helloWorld() {
        HappyFactory happyFactory = (HappyFactory) iocContext.getBean("happyFactory");
        System.out.println("happyFactory = " + happyFactory);
    }
}
